import * as React from 'react';
import type { onSelectType } from './types';
import './index.module.scss';
const { memo } = React;

interface CityProps {
  name: string;
  onSelect?: onSelectType;
}
function CityItem(props: CityProps) {
  const { name, onSelect } = props;
  return (
    <li styleName="city-li" onClick={() => onSelect&&onSelect(name)}>
      {name}
    </li>
  );
}

export default memo(CityItem);
